package pile.customer.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import pile.customer.entity.ResponseResult;
import pile.customer.service.IInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import pile.customer.entity.Information;

import pile.customer.params.information.DeleDTO;
import pile.customer.params.information.ListDTO;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 郭天义
 * @since 2024-06-03
 */
@RestController
@RequestMapping("/information")
public class InformationController {

   @Autowired
   private IInformationService informationService;



    /**
    *  列表
    * @param listDTO
    * @return
    */
    @PostMapping("/list")
    public ResponseResult listPage(@Validated @RequestBody ListDTO listDTO){
    return  informationService.listPage(listDTO);
    }


    /**
     *  列表
     * @param listDTO
     * @return
     */
    @PostMapping("/userInformationList")
    public ResponseResult userInformationList(@Validated @RequestBody ListDTO listDTO){
        return  informationService.userInformationList(listDTO);
    }

    /**
     *  客户端调用接口添加信息
     * @param information
     * @return
     */
    @PostMapping("/add")
    public ResponseResult add(@Validated @RequestBody Information information){
        return  informationService.add(information);
    }
}
